<template>
    setup
    <button @click="demo">发送数据给父组件</button>
</template>

<script>
    export default {
        props: {
            data:[String,Number]
        },
        emits:['test'],

        setup(props,context)
        {
            console.log(props.data)
            console.log(context)
        },
        methods: {
            demo()
            {
                this.$emit('test','hello son')
            }
        }
    }
</script>